home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / lib / python2.5 / idlelib / ZoomHeight.pyc (.txt) < prev   
Python Compiled Bytecode  |  2008-10-29  |  2KB  |  47 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.5)
  3.  
  4. import re
  5. import sys
  6. import macosxSupport
  7.  
  8. class ZoomHeight:
  9.     menudefs = [
  10.         ('windows', [
  11.             ('_Zoom Height', '<<zoom-height>>')])]
  12.     
  13.     def __init__(self, editwin):
  14.         self.editwin = editwin
  15.  
  16.     
  17.     def zoom_height_event(self, event):
  18.         top = self.editwin.top
  19.         zoom_height(top)
  20.  
  21.  
  22.  
  23. def zoom_height(top):
  24.     geom = top.wm_geometry()
  25.     m = re.match('(\\d+)x(\\d+)\\+(-?\\d+)\\+(-?\\d+)', geom)
  26.     if not m:
  27.         top.bell()
  28.         return None
  29.     
  30.     (width, height, x, y) = map(int, m.groups())
  31.     newheight = top.winfo_screenheight()
  32.     if sys.platform == 'win32':
  33.         newy = 0
  34.         newheight = newheight - 72
  35.     elif macosxSupport.runningAsOSXApp():
  36.         newy = 22
  37.         newheight = newheight - newy - 88
  38.     else:
  39.         newy = 0
  40.         newheight = newheight - 88
  41.     if height >= newheight:
  42.         newgeom = ''
  43.     else:
  44.         newgeom = '%dx%d+%d+%d' % (width, newheight, x, newy)
  45.     top.wm_geometry(newgeom)
  46.  
  47.